/*
 * @Description: CRM
 * @Author: lwp
 * @Date: 2021-05-15 15:23:38
 * @LastEditTime: 2021-05-15 15:25:56
 * @LastEditors: lwp
 */
/**
 * Created by PanJiaChen on 16/11/18.
 */

/**
 * @param {string} path
 * @returns {Boolean}
 */
export function isExternal (path) {
  return (/^(https?:|mailto:|tel:)/).test(path)
}

/**
 * @param {string} str
 * @returns {Boolean}
 */
export function validUsername (str) {
  // eslint-disable-next-line camelcase
  const valid_map = ['admin', 'editor']
  return valid_map.indexOf(str.trim()) >= 0
}
